/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ibrae.mchs.radiation.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author murr
 */
@Entity
@Table(name = "dic_zon", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"ID_ZON"})})
@NamedQueries({
    @NamedQuery(name = "DicZon.findAll", query = "SELECT d FROM DicZon d"),
    @NamedQuery(name = "DicZon.findByIdZon", query = "SELECT d FROM DicZon d WHERE d.idZon = :idZon"),
    @NamedQuery(name = "DicZon.findByStatusZon", query = "SELECT d FROM DicZon d WHERE d.statusZon = :statusZon")})
public class DicZon implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_ZON", nullable = false)
    private Integer idZon;
    @Basic(optional = false)
    @Column(name = "STATUS_ZON", nullable = false, length = 60)
    private String statusZon;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "dicZon")
    private Set<CrossZon> crossZonSet;

    public DicZon() {
    }

    public DicZon(Integer idZon) {
        this.idZon = idZon;
    }

    public DicZon(Integer idZon, String statusZon) {
        this.idZon = idZon;
        this.statusZon = statusZon;
    }

    public Integer getIdZon() {
        return idZon;
    }

    public void setIdZon(Integer idZon) {
        this.idZon = idZon;
    }

    public String getStatusZon() {
        return statusZon;
    }

    public void setStatusZon(String statusZon) {
        this.statusZon = statusZon;
    }

    public Set<CrossZon> getCrossZonSet() {
        return crossZonSet;
    }

    public void setCrossZonSet(Set<CrossZon> crossZonSet) {
        this.crossZonSet = crossZonSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idZon != null ? idZon.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DicZon)) {
            return false;
        }
        DicZon other = (DicZon) object;
        if ((this.idZon == null && other.idZon != null) || (this.idZon != null && !this.idZon.equals(other.idZon))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "JPAtest.entities.DicZon[idZon=" + idZon + "]";
    }

}
